home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / mmdf / mmdf-IIb.43 / lib / dial / d_setbuff.c < prev    next >
Encoding:
C/C++ Source or Header  |  1986-02-01  |  1.0 KB  |  40 lines

  1. #
  2. # include  "d_proto.h"
  3. # include  "d_returns.h"
  4. # include  <stdio.h>
  5. # include  "d_structs.h"
  6.  
  7. /*
  8.  *    D_SETBUFF
  9.  *
  10.  *    Sends the control packet indicating how deeply packets
  11.  *    can be buffered.  Actually, at the moment the only
  12.  *    relevant information is whether buffering is allowed or
  13.  *    not.  The depth of buffering is irrelavent.  However, this
  14.  *    information can be included cheaply, and it may make later
  15.  *    modifications easier, so it is given anyway.
  16.  *
  17.  *    nbuff - the depth of the buffering.
  18.  *        This number is currently 0 to indicate no buffering
  19.  *        (i.e., all packets must be ACKed immediately) or 1
  20.  *        to indicate that one outstanding packet is allowed.
  21.  *
  22. */
  23.  
  24. d_setbuff (nbuff)
  25.   int nbuff;
  26.     {
  27.     char tbuff[3], packet[MAXPACKET + 2];
  28.     int length;
  29.     extern int d_snseq;
  30.  
  31.     tbuff[0] = d_tohex ((nbuff >> 4) & 017);
  32.     tbuff[1] = d_tohex ((nbuff & 017));
  33.     tbuff[2] = '\0';
  34.  
  35.     d_snseq = d_incseq (d_snseq);
  36.     length = d_bldpack (NBUFF, d_snseq, 1, tbuff, packet);
  37.  
  38.     return (d_snpkt(NBUFF, packet, length));
  39. }
  40.